package com.example.terminalservice.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 28142
 * @description 菜单类型枚举类
 * @date 2023/8/7 0:59
 */
@Getter
@AllArgsConstructor
public enum MenuTypeEnum {
    /**
     * 目录
     */
    DIRECTORY(1, "目录"),
    /**
     * 菜单
     */
    MENU(2, "菜单"),
    /**
     * 按钮
     */
    BUTTON(3, "按钮");
    private Integer id;
    private String name;

    public static List<Map<String, Object>> getMenuTypeEnum() {
        List<Map<String, Object>> list = new ArrayList<>();
        for (MenuTypeEnum value : MenuTypeEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("label", value.getId());
            map.put("value", value.getName());
            list.add(map);
        }
        return list;
    }

}
